import {Injectable} from '@angular/core';
import {HttpService} from '@kylin/http';

@Injectable({
    providedIn: 'root'
})
export class RoleDetailService{
    constructor(private http: HttpService) {}

    addRole(roleInfo) {
        this.processParams(roleInfo);
        return this.http.post('/roles', roleInfo)
    }
    processParams(params) {
        Object.keys(params).map(key => {
            params[key] = (params[key] === null || params[key] === undefined) ? '' : params[key] ;
        })
    }
}
